<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:forgeview="http://jboss.org/forge/view"	
	template="/resources/templates/pageTemplate.xhtml">

	<f:metadata>
		<f:viewParam name="id" value="#{sysUserRoleBean.id}"/>
		<f:event type="preRenderView" listener="#{sysUserRoleBean.retrieve}"/>
	</f:metadata>

	<ui:param name="pageTitle" value="Create Sys User Role"/>

	<ui:define name="header">
		Sys User Role
	</ui:define>

	<ui:define name="subheader">
		<c:choose>
			<c:when test="#{!empty sysUserRoleBean.id}">
				Edit existing Sys User Role
			</c:when>
			<c:otherwise>
				Create a new Sys User Role
			</c:otherwise>
		</c:choose>
	</ui:define>

	<ui:define name="footer"/>

	<ui:define name="main">
		<h:form id="create">
			<h:messages globalOnly="true" styleClass="error"/>

			<h:panelGrid columnClasses="label,component,required" columns="3">
				<h:outputLabel for="sysUserRoleBeanSysUserRoleRoleName" value="Role Name:"/>
				<h:panelGroup>
					<h:inputText id="sysUserRoleBeanSysUserRoleRoleName" maxLength="50" value="#{sysUserRoleBean.sysUserRole.roleName}"/>
					<h:message for="sysUserRoleBeanSysUserRoleRoleName" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysUserRoleBeanSysUserRoleRoleDescr" value="Role Descr:"/>
				<h:panelGroup>
					<h:inputText id="sysUserRoleBeanSysUserRoleRoleDescr" maxLength="100" value="#{sysUserRoleBean.sysUserRole.roleDescr}"/>
					<h:message for="sysUserRoleBeanSysUserRoleRoleDescr" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysUserRoleBeanSysUserRoleSysUserLogins" value="Sys User Logins:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{sysUserRoleBean.sysUserRole.sysUserLogins}"/>
					<h:dataTable id="sysUserRoleBeanSysUserRoleSysUserLogins" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Sys Org"/>
							</f:facet>
							<h:link outcome="/form/sysUserLogin/view">
								<f:param name="id" value="#{_item.userNo}"/>
								<h:outputText id="forgeviewdisplayitemSysOrg" value="#{forgeview:display(_item.sysOrg)}"/>
							</h:link>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Hr Emp"/>
							</f:facet>
							<h:link outcome="/form/sysUserLogin/view">
								<f:param name="id" value="#{_item.userNo}"/>
								<h:outputText id="forgeviewdisplayitemHrEmp" value="#{forgeview:display(_item.hrEmp)}"/>
							</h:link>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Sys User Role"/>
							</f:facet>
							<h:link outcome="/form/sysUserLogin/view">
								<f:param name="id" value="#{_item.userNo}"/>
								<h:outputText id="forgeviewdisplayitemSysUserRole" value="#{forgeview:display(_item.sysUserRole)}"/>
							</h:link>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="User Name"/>
							</f:facet>
							<h:link outcome="/form/sysUserLogin/view">
								<f:param name="id" value="#{_item.userNo}"/>
								<h:outputText id="itemUserName" value="#{_item.userName}"/>
							</h:link>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="User Password"/>
							</f:facet>
							<h:link outcome="/form/sysUserLogin/view">
								<f:param name="id" value="#{_item.userNo}"/>
								<h:outputText id="itemUserPassword" value="#{_item.userPassword}"/>
							</h:link>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
						</h:column>
					</h:dataTable>
					<h:panelGrid columnClasses=",remove-column" columns="2" styleClass="data-table-footer">
						<h:selectOneMenu converter="#{sysUserLoginBean.converter}" id="sysUserRoleBeanSysUserRoleSysUserLoginsSelect" value="#{requestScope['sysUserRoleBeanSysUserRoleSysUserLoginsSelect']}">
							<f:selectItem/>
							<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{sysUserLoginBean.all}" var="_item"/>
						</h:selectOneMenu>
						<h:commandLink action="#{_collection.add(requestScope['sysUserRoleBeanSysUserRoleSysUserLoginsSelect'])}" id="sysUserRoleBeanSysUserRoleSysUserLoginsAdd" onclick="if (document.getElementById(document.forms[0].id+':sysUserRoleBeanSysUserRoleSysUserLoginsSelect').selectedIndex &lt; 1) { alert('Must select a Sys User Login'); return false; }" styleClass="add-button"/>
					</h:panelGrid>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysUserRoleBeanSysUserRoleSysApproveLevels" value="Sys Approve Levels:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{sysUserRoleBean.sysUserRole.sysApproveLevels}"/>
					<h:dataTable id="sysUserRoleBeanSysUserRoleSysApproveLevels" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Approved Level Descr"/>
							</f:facet>
							<h:link outcome="/form/sysApproveLevel/view">
								<f:param name="id" value="#{_item.approvedLevelNo}"/>
								<h:outputText id="itemApprovedLevelDescr" value="#{_item.approvedLevelDescr}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sysApproveLevelBeanAddApprovedLevelDescr" maxLength="50" value="#{sysApproveLevelBean.add.approvedLevelDescr}"/>
								<h:message for="sysApproveLevelBeanAddApprovedLevelDescr" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Approved Level Val"/>
							</f:facet>
							<h:link outcome="/form/sysApproveLevel/view">
								<f:param name="id" value="#{_item.approvedLevelNo}"/>
								<h:outputText id="itemApprovedLevelVal" value="#{_item.approvedLevelVal}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sysApproveLevelBeanAddApprovedLevelVal" value="#{sysApproveLevelBean.add.approvedLevelVal}"/>
								<h:message for="sysApproveLevelBeanAddApprovedLevelVal" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
							<f:facet name="footer">
								<h:commandLink action="#{_collection.add(sysApproveLevelBean.added)}" id="sysUserRoleBeanSysUserRoleSysApproveLevelsAdd" styleClass="add-button">
									<f:setPropertyActionListener target="#{sysApproveLevelBean.add.sysUserRole}" value="#{sysUserRoleBean.sysUserRole}"/>
								</h:commandLink>
							</f:facet>
						</h:column>
					</h:dataTable>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysUserRoleBeanSysUserRoleSysUserLogins1" value="Sys User Logins_1:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{sysUserRoleBean.sysUserRole.sysUserLogins_1}"/>
					<h:dataTable id="sysUserRoleBeanSysUserRoleSysUserLogins1" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Sys Org"/>
							</f:facet>
							<h:link outcome="/form/sysUserLogin/view">
								<f:param name="id" value="#{_item.userNo}"/>
								<h:outputText id="forgeviewdisplayitemSysOrg" value="#{forgeview:display(_item.sysOrg)}"/>
							</h:link>
							<f:facet name="footer">
								<h:selectOneMenu converter="#{sysOrgBean.converter}" id="sysUserLoginBeanAddSysOrg" value="#{sysUserLoginBean.add.sysOrg}">
									<f:selectItem/>
									<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{sysOrgBean.all}" var="_item"/>
								</h:selectOneMenu>
								<h:message for="sysUserLoginBeanAddSysOrg" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Hr Emp"/>
							</f:facet>
							<h:link outcome="/form/sysUserLogin/view">
								<f:param name="id" value="#{_item.userNo}"/>
								<h:outputText id="forgeviewdisplayitemHrEmp" value="#{forgeview:display(_item.hrEmp)}"/>
							</h:link>
							<f:facet name="footer">
								<h:selectOneMenu converter="#{hrEmpBean.converter}" id="sysUserLoginBeanAddHrEmp" value="#{sysUserLoginBean.add.hrEmp}">
									<f:selectItem/>
									<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{hrEmpBean.all}" var="_item"/>
								</h:selectOneMenu>
								<h:message for="sysUserLoginBeanAddHrEmp" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="User Name"/>
							</f:facet>
							<h:link outcome="/form/sysUserLogin/view">
								<f:param name="id" value="#{_item.userNo}"/>
								<h:outputText id="itemUserName" value="#{_item.userName}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sysUserLoginBeanAddUserName" maxLength="50" value="#{sysUserLoginBean.add.userName}"/>
								<h:message for="sysUserLoginBeanAddUserName" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="User Password"/>
							</f:facet>
							<h:link outcome="/form/sysUserLogin/view">
								<f:param name="id" value="#{_item.userNo}"/>
								<h:outputText id="itemUserPassword" value="#{_item.userPassword}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sysUserLoginBeanAddUserPassword" maxLength="50" value="#{sysUserLoginBean.add.userPassword}"/>
								<h:message for="sysUserLoginBeanAddUserPassword" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="User Descr"/>
							</f:facet>
							<h:link outcome="/form/sysUserLogin/view">
								<f:param name="id" value="#{_item.userNo}"/>
								<h:outputText id="itemUserDescr" value="#{_item.userDescr}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sysUserLoginBeanAddUserDescr" maxLength="100" value="#{sysUserLoginBean.add.userDescr}"/>
								<h:message for="sysUserLoginBeanAddUserDescr" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
							<f:facet name="footer">
								<h:commandLink action="#{_collection.add(sysUserLoginBean.added)}" id="sysUserRoleBeanSysUserRoleSysUserLogins1Add" styleClass="add-button">
									<f:setPropertyActionListener target="#{sysUserLoginBean.add.sysUserRole}" value="#{sysUserRoleBean.sysUserRole}"/>
								</h:commandLink>
							</f:facet>
						</h:column>
					</h:dataTable>
				</h:panelGroup>
				<h:outputText/>
			</h:panelGrid>

			<div class="buttons">
				<h:commandLink value="Save" action="#{sysUserRoleBean.update}" styleClass="btn btn-primary"/>
				<c:choose>
					<c:when test="#{!empty sysUserRoleBean.id}">
						<h:link value="Cancel" outcome="view" styleClass="btn btn-primary">
							<f:param name="id" value="#{sysUserRoleBean.id}"/>
						</h:link>
						<h:commandLink value="Delete" action="#{sysUserRoleBean.delete}" styleClass="btn btn-primary"/>
					</c:when>
					<c:otherwise>
						<h:link value="Cancel" outcome="search" styleClass="btn btn-primary"/>
					</c:otherwise>
				</c:choose>
			</div>
		</h:form>
	</ui:define>

</ui:composition>